var express = require('express');
var conn = require('../public/javascripts/connect');
var judge_login = require('../public/javascripts/judge_login');
var router = express.Router();
router.get("/",async function (req, res){
    let Jurisdiction=null;
    let user={};
    if(req.cookies.jinshan_rabbing){
        Jurisdiction=await judge_login.judgelogin(req.cookies.jinshan_rabbing);
        console.log(Jurisdiction);
        if(Jurisdiction){
            user.department_number=Jurisdiction.department_number;
            user.real_name=Jurisdiction.real_name;
        }
    };
    console.log("usersfsdbfs",user)
    if(Jurisdiction){
        res.render("home",{user})
    }else{
        res.render("home",{user})
    }
})
module.exports = router;